version: '3.8'
services:
  gateway:
    build: gateway
    image: gateway
    container_name: gateway
    ports:
      - "8080:8080"
    environment:
      - SHAREIT_SERVER_URL=http://server:9090

  server:
    build: server
    image: server
    container_name: server
    ports:
      - "9090:9090"
    depends_on:
      - db
    environment:
      - SPRING_DATASOURCE_URL=jdbc:postgresql://db:5432/shareit
      - POSTGRES_USER=login
      - POSTGRES_PASSWORD=password

  db:
    image: postgres:13.7-alpine
    container_name: db
    ports:
      - "6541:5432"
    environment:
      - POSTGRES_DB=shareit
      - POSTGRES_USER=login
      - POSTGRES_PASSWORD=password